<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:t="http://myfaces.apache.org/tomahawk">

	<ui:composition>
		<script type="text/javascript">  
			function valideInputDes() {
				var cadena = document.getElementById("idModalManArbolClases:idMessageError").innerHTML;
			    if(cadena == null || cadena.length == 0){
			    	popNewUpdateArbolClases.hide();
			    }
			}  
		</script>
		<p:dialog id="newUpdateArbolClases" header="#{paramArbolClaseController.tituloModal}"
			widgetVar="popNewUpdateArbolClases" modal="true" width="400" appendToBody="true">
			<h:form id="idModalManArbolClases">
				<h:panelGrid headerClass="cabeceraPanelSimple" cellspacing="0"
					cellpadding="5" styleClass="bordePanel"
					style="width:100%; margin-left: -2px; margin-bottom:5px" columns="1">
	
					<h:panelGrid columns="2" style="margin-top:-25px;" cellspacing="2" cellpadding="2">
						<p:spacer width="90" height="15" ></p:spacer>
						<p:spacer width="230" height="15" ></p:spacer>
	
						<h:outputText value="Nodo:" styleClass="texto" />
						<h:inputText id="idNodeValDescripcion" styleClass="cajaST" style="width:150px" maxlength="100"
						value="#{paramArbolClaseController.nodeArbolClaseFIAForm.descripcion}"></h:inputText>
						
						<h:outputText value="" />
						<h:outputText value="#{paramArbolClaseController.messageErrorModal}" style="color:red" id="idMessageError" />
						
						<h:outputText value="Cod. Situación:" styleClass="texto" />
						<h:selectOneMenu value="#{paramArbolClaseController.nodeArbolClaseFIAForm.codSituacion}">
				            <f:selectItem itemLabel="S" itemValue="S" />
				            <f:selectItem itemLabel="N" itemValue="N" />
				        </h:selectOneMenu>
					</h:panelGrid>
					<h:panelGrid id="idlistCheckClaseFIA" headerClass="cabeceraPanelSimple" columns="1" cellspacing="0"
						cellpadding="5" styleClass="bordePanel"
						style="width:100%;margin-left: 0px;margin-top: 3px;margin-bottom:5px"
						rendered="#{paramArbolClaseController.showCheckClases}">
						<f:facet name="header">
							<table cellpadding="0" cellspacing="0" width="100%" border="0">
								<tr>
									<td>
										<h:outputText value="Clases asignadas" style="align:right;" />
									</td>
								</tr>
							</table>
						</f:facet>
						<h:panelGrid columns="2">
							<p:selectManyCheckbox value="#{paramArbolClaseController.listCheckClaseFIASeleccionado}" 
								converter="claseFIAConverter" layout="pageDirection">  
						    	<f:selectItems value="#{paramArbolClaseController.listCheckClaseFIA}" />
						    </p:selectManyCheckbox>
					    </h:panelGrid>
				    </h:panelGrid>
				    <h:panelGrid columns="2" cellspacing="2" cellpadding="2">
						<p:commandButton id="confirmSaveArbolClase" value="Guardar" actionListener="#{paramArbolClaseController.insertUpdateNodeArbolClaseFIA}" 
							oncomplete="valideInputDes()" update=":formPrincipal:growl,:formPrincipal:idContentMain:idDataArbol,:idModalManArbolClases:idMessageError"/>
		        		<p:commandButton id="declineSaveArbolClase" value="Cancelar" onclick="popNewUpdateArbolClases.hide()" type="button" />
	        		</h:panelGrid>
				</h:panelGrid>
			</h:form>
		</p:dialog>
	</ui:composition>
</jsp:root>